package cvut.fit.dpo.arithmetic;

import cvut.fit.dpo.arithmetic.elements.AddOperation;
import cvut.fit.dpo.arithmetic.elements.ExpressionElement;

/**
 * Represents + operation
 * 
 * @author Jan Kurš
 * 
 */
public class AddOperator extends BinaryOperator {

	public AddOperator(final ArithmeticExpression firstOperand,final ArithmeticExpression secondOperand) {
		super(firstOperand, secondOperand);
	}

	@Override
	public Integer evaluate() {
		return getFirstOperand().evaluate() + getSecondOperand().evaluate();
	}

	@Override
	public ExpressionElement getRepresentationInExpresionModel() {
		return new AddOperation();
	}

}
